#ifndef _ERROR_H_
#define _ERROR_H_
#include "stm32l0xx_hal.h"
#include "stm32l0xx_nucleo.h"

#define APP_BLE_IRQ_FLAG_OVER           0x01
#define APP_BLE_IRQ_COUNT_FAULT         0x02

#define APP_IP_RX_BUF_OVER_ERROR        0x03

#define APP_TFTP_OPCODE_ERROR			        0x04

#define APP_OTA_ERASE_ERROR             0x05
#define APP_OTA_BOOOTLOADER_CRC_ERROR   0x06
#define APP_OTA_PROGRAM_ERROR           0x07

/*iwdg error*/
#define APP_WDG_ERROR                   0x08
/*eeprom error*/
#define APP_EEPROM_ERROR                0x09
#define APP_EEPROM_WRITE_ERROR          0x0A
#define APP_EEPROM_ERASE_ERROR          0x0B
/*lis2dh12 error*/
#define APP_LIS2DH12_BEGIN_ERROR        0x0C
#define APP_LIS2DH12_PROCESS_ERROR      0x0D
#define APP_LIS2DH12_END_ERROR          0x0E
#define APP_LIS2DH12_PARAM_ERROR        0x0F
/*sht3x_dis error*/
#define APP_SHT3X_DIS_BEGIN_ERROR       0x10
#define APP_SHT3X_DIS_READ_ERROR        0x11
/*config information*/
#define APP_LIS2DH12_CONFIG_ERROR      0x12
#define APP_SHT3X_DIS_CONFIG_ERROR     0x13
#define APP_BLUENRG_CONFIG_ERROR       0x14

#define APP_3AXIS_BUFFER_OVER          0x15
#define APP_READ_DMA_ISSUE_EEROR       0x16
/*voltage*/
#define APP_VOLTAGE_ERROR              0x17
/*hard fault*/
#define HARD_FAULT_ERROR               0x18


#define APP_IP_BLE_RX_PKT_INFO         	0x01
#define APP_IP_BLE_RX_PKT_OK_INFO       0x02
#define APP_TFTP_TX_BEGIN_INFO					     0x03
#define APP_TFTP_TX_INFO							         0x04
#define APP_TFTP_TX_END_INFO						      0x05
#define APP_BLE_READ_EVENT_BEGIN_INFO			0x06
#define APP_BLE_READ_EVENT_OK_INFO			   0x07
#define APP_BLE_EVENT_HANDLE_INFO						 0x08
#define APP_OTA_ERASE_BEGIN_INFO        0x09
#define APP_OTA_ERASE_OK_INFO           0x0A
#define APP_OTA_PROGRAM_BEGIN_INFO      0x0B
#define APP_OTA_PROGRAM_OK_INFO         0x0C



void app_fault_handle(uint8_t error);
void app_ble_log_info(uint8_t info);
#endif //_ERROR_H_
